package com.item.yxlottery.yxlottery.adapter;

/*
 *------------------------------
 * @创建者      Administrator
 * @创建时间    2016/12/19 10:51
 * @文件描述    购彩界面各个彩种的Adapter
 *------------------------------
 */

import android.content.Context;
import android.widget.ImageView;

import com.alibaba.fastjson.JSONObject;
import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.item.yxlottery.yxlottery.R;
import com.item.yxlottery.yxlottery.utils.UrlUtil;

import java.util.List;

public class LotteryAdapter extends BaseQuickAdapter<JSONObject, BaseViewHolder> {

    private Context mContext;

    public LotteryAdapter(Context context, int layoutResId, List<JSONObject> data) {
        super(layoutResId, data);
        mContext = context;
    }

    @Override
    protected void convert(BaseViewHolder helper, JSONObject item) {
        helper.setText(R.id.tv_buy_list_item_bottontext, item.getString("goodsName"));
        Glide.with(mContext).load(UrlUtil.getImageHomeUrl() + item.getString("goodsImage")).error(R.drawable.image16)
                .into((ImageView) helper.getView(R.id.iv_buy_list_item_middleicon));
    }
}
